<?php

// 设置读取文件
$filename = './tmp.txt';

if (isset($_POST['text']) && (!empty($_POST['text'])))
{
	file_put_contents($filename, $_POST['text']);
	die(json_encode(['code' => 0, 'msg' => '设置成功']));
}
$text = '';
if (is_file($filename))
{
	$text = file_get_contents($filename);
}
die(json_encode(['code' => 1, 'msg' => '复制成功', 'data' => $text]));